﻿@model IEnumerable<B4Deal.Models.Deal>
@{
    ViewBag.Title = "Trang chủ";
    
}
<div style="margin-top: 20px; height: 20px">
</div>
@{
    var count = 0;
    var dateColumn1 = String.Empty;
    var dateColumn2 = String.Empty;
}
<table  style="margin-right: 5%">
    @foreach (var item in Model)
    {
        if (count < 10)
        {
            item.Index = count;
            var eItem = Model.ElementAt(count + 10);
            eItem.Index = count + 10;
        <tr>
            <td>
                @Html.Partial("_Product", item)
            </td>
            <td>
                @Html.Partial("_Product", eItem)
            </td>
        </tr>
        dateColumn1 = item.KetThucKM.ToString();
        dateColumn2 = eItem.KetThucKM.ToString();
        var temp = count + 10;                  
        <script type="text/javascript">
            var newYear = new Date('@dateColumn1');
            var id = document.getElementById('@count');
            $(id).countdown({ until: newYear });
            newYear = new Date('@dateColumn2');
            id = document.getElementById('@temp');
            $(id).countdown({ until: newYear });
        </script>
            count++;
        }
    }
</table>
<script type="text/javascript">
    $('.defaultVote').raty();
</script>

<!--div style="position: fixed; right: 100px; top: 300px">
    <a target="_blank" href= "Model.ElementAt(0).Url(Title, Value.ToString(), "_blank", "")">
        <img alt="Thanh toan" src="http://sandbox.nganluong.vn/data/images/buttons/11.gif"
            border="0" /></a>
</div-->
